package com.example.resourceSharingPlatform.security_mappers;


import com.example.resourceSharingPlatform.security_entity.Users;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class UsersRowMapper implements RowMapper<Users> {
    @Override
    public Users mapRow(ResultSet rs, int i)throws SQLException {
        Users users = new Users();
        users.setUserName(rs.getString("user_name"));
        users.setPassword(rs.getString("password"));
        users.setStatus(rs.getString("status"));
        users.setUserId(rs.getLong("user_id"));
        users.setRoles(rs.getString("roles"));
        return users;
    }
}
